import { screen } from 'electron'

let sender: Electron.WebContents|null = null;


process.on('message', (message: { sender: Electron.WebContents }) => {
  if (message.sender) {
    setInterval(() => {
      const point = screen.getCursorScreenPoint()
      sender = message.sender;
      sender.send('offset-window:mouse-move', {
        x: point.x,
        y: point.y
      })
    }, 100)
  }
})

